//
//  MKWeiboCell.m
//  Weibo_OC
//
//  Created by mac on 16/1/23.
//  Copyright © 2016年 mac. All rights reserved.
//

#import "MKWeiboCell.h"
#import "MKOrginalView.h"
#import <Masonry.h>
#import "MKBottomToolView.h"

@interface MKWeiboCell ()

@property (strong, nonatomic) MKOrginalView* orginalView;

@property (strong, nonatomic)  MKBottomToolView* bottomToolView;

@end

@implementation MKWeiboCell

- (void)setStatue:(MKStatues *)statue {
    _statue = statue;
    
    self.orginalView.statue = statue;
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self setupUI];
    }

    return self;
}


- (void)setupUI {

    [self.contentView addSubview:self.orginalView];
    [self.contentView addSubview:self.bottomToolView];
    
    //自动布局 原创微博
    [self.orginalView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView.mas_top);
        make.left.equalTo(self.contentView.mas_left);
        make.right.equalTo(self.contentView.mas_right);
    }];
    
    //自动布局 工具条
    
    [self.bottomToolView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.orginalView.mas_bottom);
        make.left.equalTo(self.contentView.mas_left);
        make.right.equalTo(self.contentView.mas_right);
        make.height.mas_equalTo(35);
        
    }];
    
    //自动布局 计算行高
    [self.contentView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self);
        make.left.equalTo(self);
        make.right.equalTo(self);
        make.bottom.equalTo(self.bottomToolView.mas_bottom);
    }];
    

    
}

- (MKOrginalView *)orginalView {
    
    if (nil == _orginalView) {
        _orginalView = [[MKOrginalView alloc] init];
    }
    
    return _orginalView;
}

- (MKBottomToolView *)bottomToolView {
    if (nil == _bottomToolView) {
        _bottomToolView = [[MKBottomToolView alloc] init];
        _bottomToolView.backgroundColor = [UIColor redColor];
    }
    
    return _bottomToolView;
}






@end
